import cv2
import matplotlib.pyplot as plt
image =cv2.imread('lake.jpg')
cv2.imshow('Input',image)
gray=cv2.cvtColor(image,cv2.COLOR_BAYER_BG2GRAY)
eqHist=cv2.equalizeHist(gray)
cv2.imshow('equalizeHist',eqHist)
plt.figure(figsize=(10,10))
hist1=cv2.calcHist([image],[0],None,[256],[0,255])
plt.subplot(121)
plt.title('Input')
plt.plot(hist1)
